<script setup>
const props = defineProps({
  itemData: {
    type: Object,
    default: () => ({}),
  },
})
</script>

<template>
  <div class="house-item-v9">
    <div class="card">
      <div class="bg">
        <img :src="itemData.image.url" alt="" />
      </div>

      <div class="info">
        <div class="summary">{{ itemData.summaryText }}</div>
        <div class="name">{{ itemData.houseName }}</div>
        <div class="price">
          <van-rate
            :model-value="Number(itemData.commentScore)"
            color="#fff"
            :size="15"
            readonly
            allow-half
          />
          <div class="new">¥ {{ itemData.finalPrice }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="less" scoped>
.house-item-v9 {
  width: 50%;
  .card {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    margin: 5px;
    background-color: #fff;
    .bg {
      img {
        width: 100%;
        border-radius: 0 0 6px 6px;
      }
    }

    .info {
      position: absolute;
      bottom: 0;
      padding: 8px 10px;
      color: #fff;
    }
    .summary {
      font-size: 12px;
    }
    .name {
      margin: 5px 0;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    .price {
      display: flex;
      justify-content: space-between;
    }
  }
}
</style>
